Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(files_versions): Refactor function for lisibility #48325

Closed
wants to merge 1 commit into from

Conversation

solracsf
Copy link
Member

Checklist

@solracsf solracsf added 3. to review Waiting for reviews ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) labels Sep 24, 2024
@solracsf solracsf added this to the Nextcloud 31 milestone Sep 24, 2024
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>

fix: typo
@kesselb
Copy link
Contributor

kesselb commented Sep 24, 2024

I don't consider that an improvement 🙈

Fine by me, but please fix the commit message ;)

@solracsf
Copy link
Member Author

solracsf commented Sep 24, 2024

Sure, opinions.
Mine is that moving from 40+ lines to 15 is more readable/maintainable and match perfectly...matches this usage, hence the PR (to be reviewed). 😄

What's wrong with the commit message? 🤔

@susnux susnux requested review from provokateurin and come-nc and removed request for skjnldsv and susnux September 24, 2024 19:23
@susnux
Copy link
Contributor

susnux commented Sep 24, 2024

Removed my assignment as this is php code style related which I would pass to @come-nc and @provokateurin for files backend

@kesselb
Copy link
Contributor

kesselb commented Sep 24, 2024

The commit type should be "refactoring" "refactor" instead of "chore" https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#type.

lisbility => legibility or readability

Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @kesselb, it's not really better than before.
It also abuses the match functionality, so I don't really like that either.

@@ -331,7 +302,7 @@ public function pre_renameOrCopy_hook(Node $source, Node $target): void {
$manager = Filesystem::getMountManager();
$mount = $manager->find($absOldPath);
$internalPath = $mount->getInternalPath($absOldPath);
if ($internalPath === '' and $mount instanceof MoveableMount) {
if ($internalPath === '' && $mount instanceof MoveableMount) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a cs fixer rule for this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rector does this as well, I've never seen anyone use this syntax in recent years so it is only in legacy code anyway.

@come-nc
Copy link
Contributor

come-nc commented Sep 26, 2024

I agree with the others, I dislike using match like this. It’s harder to read as the calls are not aligned with each other anymore.
Closing. The and thing is not big enough to justify a PR.

@come-nc come-nc closed this Sep 26, 2024
@provokateurin provokateurin deleted the filesVersionsFuncRefact branch September 26, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants